package com.wrbug.mmkw

import com.tencent.mmkv.MMKV

/**
 *   BaseMmkvTaskerImpl.kt
 *   author: wrbug
 *   date: 2019-09-24 12:50
 *
 */

open class BaseMmkvTaskerImpl(kv: MMKV) : BaseMmkvTasker {
    @JvmField
    protected var kv: MMKV = kv

    override fun getMmkv() = kv
    override fun lock() {
        kv.lock()
    }

    override fun unlock() {
        kv.unlock()
    }

    override fun tryLock() = kv.tryLock()

    override fun getValueSize(key: String) = kv.getValueSize(key)

    override fun getValueActualSize(key: String) = kv.getValueActualSize(key)

    override fun containsKey(key: String) = kv.containsKey(key)

    override fun allKeys() = kv.allKeys()

    override fun count() = kv.count()

    override fun totalSize() = kv.totalSize()

    override fun clearAll() {
        kv.clearAll()
    }

    override fun trim() {
        kv.trim()
    }

    override fun close() {
        kv.close()
    }

    override fun clearMemoryCache() {
        kv.clearMemoryCache()
    }

    override fun sync() {
        kv.sync()
    }

    override fun async() {
        kv.async()
    }

    override fun commit() = kv.commit()

    override fun apply() {
        kv.apply()
    }

    override fun contains(key: String) = kv.contains(key)


    override fun ashmemFD() = kv.ashmemFD()

    override fun ashmemMetaFD() = kv.ashmemMetaFD()

    override fun checkContentChangedByOuterProcess() {
        kv.checkContentChangedByOuterProcess()
    }
}